#! /bin/sh

#可执行文件名称
jarname=test
mainCls=test.main.App

jarfile=$jarname.jar

#开始启动
start(){
    exec java -Xms512m -Xmx512m -cp ./conf:$jarfile $mainCls 5 > logs/log.log
}

#停止运行
stop(){
    ps -ef|grep $jarname|grep -v grep|awk '{print $2}'|while read pid
    do
        kill -9 $pid
    done
}

#执行配置
case "$1" in
start)
  start
  ;;
stop)
  stop
  ;;
restart)
  stop
  start
  ;;
*)
  printf 'Use cmd as: %s {start|stop|restart}\n' "$prog"
  exit 1
  ;;
esac
